<%-- 
    Document   : add
    Created on : 16-dic-2011, 9.19.42
    Author     : Admin
--%>

<%@page import="entity.Shelf"%>
<%@page import="java.util.List"%>

<%
    List<Shelf> shelves = (List<Shelf>) request.getAttribute("shelves");
%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1>Add book:</h1>
        
        <form action="BookServlet" method="GET"/>
            <input type="hidden" name="action" value="reallyAdd"/>
            <label>Title: <input type="text" name="title"/></label><br/>
            <label>Author: <input type="text" name="author"/></label><br/>
            <label>Select a shelf...</label>
            <select name="shelfS" >
                <%
                    for(Shelf s: shelves){
                %>
                        <option><%= s.getGenre() %></option>
                <%
                    }
                %>
            </select><br/>
            <label>...or add a new one: <input type="text" name="shelfT"/></label><br/>
            
            <input type="submit" value="Add book"/>
        </form>
        
        <a href="index.jsp">Back to index </a>
    </body>
</html>
